#pragma once
#include <d3d9.h>
#include "Node.h"
#include "OBB.h"
class Material;


class Mesh:public Node
{
	IDirect3DVertexBuffer9 *vertexBuffer;
	IDirect3DIndexBuffer9 *indexBuffer;
	IDirect3DVertexDeclaration9 *vdecl;
	UINT vbStride;//stride in vertex buffer
	Material *mtrl;
	OBB obb;
	UINT vertCount;
	UINT trisCount;
public:

	Mesh( IDirect3DVertexBuffer9* vb, IDirect3DIndexBuffer9* ib, IDirect3DVertexDeclaration9 *vdecl, Material *mtrl, UINT stride, OBB &obb, UINT vCount, UINT trCount );
	IDirect3DVertexBuffer9 *GetVertexBuffer();
	IDirect3DIndexBuffer9 *GetIndexBuffer();
	IDirect3DVertexDeclaration9 *GetVertexDeclaration();
	UINT CountVertices();
	UINT CountTriangles();
	UINT GetVertexStride();
	Material *GetMaterial();
};